home *** CD-ROM | disk | FTP | other *** search
/ Delphi Developer's Kit 1996 / Delphi Developer's Kit 1996.iso / power / glyphpro / options.pas < prev    next >
Pascal/Delphi Source File  |  1995-12-22  |  3KB  |  95 lines

  1. unit Options;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, StdCtrls, Buttons, Spin, ExtCtrls, SelDir;
  8.  
  9. type
  10.   TFormOptions = class(TForm)
  11.     PanelOptions: TPanel;
  12.     BitBtnOK: TBitBtn;
  13.     BitBtnCancel: TBitBtn;
  14.     Bevel1: TBevel;
  15.     GroupBox1: TGroupBox;
  16.     GroupBox2: TGroupBox;
  17.     Label1: TLabel;
  18.     SpinEditBtnSize: TSpinEdit;
  19.     Label2: TLabel;
  20.     Label3: TLabel;
  21.     EditBtnsPerPage: TEdit;
  22.     ComboBoxGlyphs: TComboBox;
  23.     ListBoxDirectory: TListBox;
  24.     BitBtnAdd: TBitBtn;
  25.     BitBtnDelete: TBitBtn;
  26.     GroupBoxDelphiDir: TGroupBox;
  27.     EditDelphiDir: TEdit;
  28.     procedure BitBtnAddClick(Sender: TObject);
  29.     procedure BitBtnOKClick(Sender: TObject);
  30.     procedure FormCreate(Sender: TObject);
  31.     procedure BitBtnDeleteClick(Sender: TObject);
  32.   private
  33.     { Private declarations }
  34.   public
  35.     { Public declarations }
  36.   end;
  37.  
  38. implementation
  39. uses
  40.   Main;
  41. {$R *.DFM}
  42.  
  43. procedure TFormOptions.BitBtnAddClick(Sender: TObject);
  44. var FormSelectDirectory: TFormSelectDirectory;
  45. begin
  46.   FormSelectDirectory := TFormSelectDirectory.Create(Self);
  47.   FormSelectDirectory.ShowModal;
  48.   FormSelectDirectory.Free;
  49. end;
  50.  
  51. procedure TFormOptions.BitBtnOKClick(Sender: TObject);
  52. var
  53.   i: integer;
  54. begin
  55.   with Form1 do
  56.   begin
  57.     ComboBoxDir.Clear;
  58.     for i := 0 to ListBoxDirectory.Items.Count - 1 do
  59.       ComboBoxDir.Items.Strings[i] :=
  60.                                  ListBoxDirectory.Items.Strings[i];
  61.     ComboBoxDir.ItemIndex := 0;
  62.     SpeedButtonDisplay.Caption := '&Display';
  63.     SpeedButtonPgDn.Enabled := FALSE;
  64.     iButSize := StrToInt(SpinEditBtnSize.Text);
  65.     iNumOfGlyphs := StrToInt(ComboBoxGlyphs.Text);
  66.     iSetLimit := StrToInt(EditBtnsPerPage.Text);
  67.     DeleteOldButs;
  68.   end;
  69. end;
  70.  
  71. procedure TFormOptions.FormCreate(Sender: TObject);
  72. var
  73.   i: integer;
  74. begin
  75.   for i := 0 to Form1.ComboBoxDir.Items.Count - 1 do
  76.     ListBoxDirectory.Items.Add(Form1.ComboBoxDir.Items.Strings[i]);
  77.   ListBoxDirectory.ItemIndex := 0;
  78.   ComboBoxGlyphs.Items.Add('1');
  79.   ComboBoxGlyphs.Items.Add('2');
  80.   ComboBoxGlyphs.Items.Add('3');
  81.   ComboBoxGlyphs.Items.Add('4');
  82.   ComboBoxGlyphs.Text := IntToStr(Form1.iNumOfGlyphs);
  83.   EditBtnsPerPage.Text := IntToStr(Form1.iSetLimit);
  84.   SpinEditBtnSize.Text := IntToStr(Form1.iButSize);
  85. end;
  86.  
  87. procedure TFormOptions.BitBtnDeleteClick(Sender: TObject);
  88. begin
  89.   with ListBoxDirectory.Items do
  90.     Delete(ListBoxDirectory.ItemIndex); { delete the highlighted item }
  91.   ListBoxDirectory.ItemIndex := 0;
  92. end;
  93.  
  94. end.
  95.